package routers

import (
	"gin-gorm-project/service/blog_service"
	"github.com/gin-gonic/gin"
)

func BlogRouters(r *gin.Engine) {
	var blogService = &blog_service.BlogService{}
	blogRouters := r.Group("/blog")

	// 获取所有数据
	blogRouters.GET("/queryList", blogService.QueryList)
	// 生成测试数据
	blogRouters.GET("/buildManyDemoData", blogService.BuildManyDemoData)
	// 分页查询
	blogRouters.POST("/queryByPage", blogService.QueryByPage)
	// 保存
	blogRouters.POST("/save", blogService.Save)
	// 查询通过ID
	blogRouters.GET("/queryById/:id", blogService.QueryById)

}
